import React, { memo } from 'react'
import { BackTop } from 'antd'

export default memo(function () {
  const style = {
    height: 500,
    width: 30,
    lineHeight: '40px',
    borderRadius: 4,
    color: '#fff',
    textAlign: 'center',
    fontSize: 14,
    position: 'fixed',
    top: 0,
    zIndex: 99
  }

  return (
    <>
      <BackTop className="back-top" duration={700} visibilityHeight={800}>
        <div style={style}>
          <img
            className="scroll-up"
            src="https://upload-images.jianshu.io/upload_images/20040970-aa9f7355b6fd410e.png"
            alt="回到顶部"
          />
        </div>
      </BackTop>
    </>
  )
})
